/*
 * @Description:沙发
 * @Author: maskMan
 * @LastEditTime: 2024-10-21 09:06:14
 */
const { ccclass, property } = cc._decorator
@ccclass
export class seatpre728 extends cc.Component {
  gameNode: cc.Node
  gameScript: any
  currentSpeed = null
  start() {
    const index = 'game728'
    this.gameNode = cc.find(`Canvas/modules/gamePanel/gameNode/${index}`)
    this.gameScript = cc.find(`Canvas/modules/gamePanel/gameNode/${index}`).getComponent(index)
    this.node.runAction(
      cc
        .sequence(cc.moveTo(this['speed'], 500, this.node.y), cc.moveTo(this['speed'], -500, this.node.y))
        .repeatForever()
    )
  }
  onCollisionEnter(other: cc.Collider, self: cc.Collider) {
    this.gameNode.emit('onhit', self.node, other.node)
  }
}
